package com.jianying.func;

import com.jianying.beans.WaterSensor;
import org.apache.flink.api.common.functions.MapFunction;

/**
 * ClassName: WaterSensorMapFunction
 * Package: com.atguigu.func
 * Description:
 *
 * @Author: tubage
 * @Create: 2024/4/1 16:07
 * @Version: 1.0
 */
public class WaterSensorMapFunction implements MapFunction<String,WaterSensor> {
    @Override
    public WaterSensor map(String s) throws Exception {
        String[] fieldArr = s.split(",");
        return new WaterSensor(fieldArr[0], Long.valueOf(fieldArr[1]), Integer.valueOf(fieldArr[2]));
    }
}
